package com.company;

import java.util.Scanner;

public class webhh {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int start = scanner.nextInt();
		int end = scanner.nextInt();
		
		int num = 0;
		Long ro = 0L;
		for(int i = 1; i <= end; i++) {
			ro += add(i);
			if(start <= i && ro%3 == 0) {
				num++;
			}
		}
		System.out.println(num);
	}

	private static int add(int i) {
		// TODO �Զ����ɵķ������
		if(i < 10)
			return i;
		else {
			int s = i/10;
			int y = i%10;
			return s+y;
		}
	}
	
	
}
